#include <iostream>
#include <functional>

int add(int a,int b,int c)
{
    return a + b + c;
}

int main()
{
    //重新定义函数的调用方式:
    int count = 100;
   //std::function<int(int,int)> f = std::bind(add,std::placeholders::_1,std::placeholders::_2,count);
    std::function<int(int,int)> f = [count](int a,int b)
    {
        return add(a,b,count);
    };
    std::cout<<f(1,2)<<std::endl;
    return 0;
}